<%@ Page Language="C#" MasterPageFile="~/MasterPages/manager/manager.master" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="manager_inventory_Default" Title="Untitled Page" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<script language="javascript" type="text/javascript">
<!--

function ddlAction_onclick() {

}

// -->
</script>

<h2>Product Catalogue</h2>
<p>Manage your inventory here.</p>
<h3>Other Useful Links</h3>
    <asp:HyperLink ID="linkCategories" runat="server" NavigateUrl="~/manager/inventory/Categories.aspx">Product Categories</asp:HyperLink>
    - How your site visitors can locate your products<br />
    <br />
    <asp:HyperLink ID="linkOptionDefs" runat="server" NavigateUrl="~/manager/inventory/ProductOptionTypes.aspx">Define Product Options</asp:HyperLink>
    - The extra data that can be attached to a product, such as "Make", "Model", "Weight",
    etc
    <h2>Inventory</h2>
        <%=StartRoundCorner() %>
            <!-- content goes here -->
            <asp:DropDownList id="ddlAction" runat="server" OnSelectedIndexChanged="ddlAction_SelectedIndexChanged" AutoPostBack="True"><asp:ListItem Selected="True">Select an action...</asp:ListItem>
            <asp:ListItem Value="delete">Delete selected products</asp:ListItem>
            </asp:DropDownList>
                <asp:HyperLink ID="linkCSVUpload" runat="server" NavigateUrl="~/manager/inventory/InventoryUpdate.aspx">Update your inventory by bulk upload</asp:HyperLink>
                &nbsp;&nbsp;|&nbsp;&nbsp;
                <asp:HyperLink ID="linkNewProduct" runat="server" NavigateUrl='<%#string.Format("~/manager/inventory/AddUpdateProduct.aspx?lastCid={0}",_categoryId) %>'>Create a New Product</asp:HyperLink>
          <%=EndRoundCorner() %>
    <asp:Literal runat="server" ID="litInventory"></asp:Literal>
    <table width="100%" height="100%" cellspacing="0" cellpadding="0" border="0">
        <tr>
            <td width="30%" valign="top">
            <div class="AspNet-TreeView">
            <%=new TanashCMS.Business.Task.InventoryTask(mWebsite.ID).GenerateCategoryTree(0, _categoryId, "Default.aspx?cid={0}", "{1}", "", "", "AspNet-TreeView-Selected" ) %>
            </div>
            </td>
            <td width="70%" valign="top">
            <h3><asp:Literal runat="server" ID="litCategoryHeading" /></h3>
            <asp:Repeater runat="server" ID="rptInventory" OnItemCommand="rptInventory_OnItemCommand">
                <HeaderTemplate>
                    <table width="100%" border="1" cellspacing="0" cellpadding="1">
                        <thead>
                            <tr>
                                <th>&nbsp;</th>
                                <th>UPC</th>
                                <th>Title</th>
                                <th>&nbsp;</th>
                            </tr>
                        </thead>
                        <tbody>
                </HeaderTemplate>
                <ItemTemplate>
                    <asp:HiddenField runat="server" ID="productId" Value='<%#Eval("ID") %>' />
                    <tr>
                        <td><%#Eval("OrderIndex") %><asp:CheckBox runat="server" ID="chkSelectProduct" /> </td>
                        <td><a href="AddUpdateProduct.aspx?id=<%#Eval("ID") %>&lastCid=<%=_categoryId %>"><%#Eval("UPC") %></a></td>
                        <td><a href="AddUpdateProduct.aspx?id=<%#Eval("ID")%>&lastCid=<%=_categoryId %>"><%#Eval("Title") %></a></td>
                        <td><asp:Button runat="server" ID="btnUp" Text="Up" CommandName="MoveUp" CommandArgument='<%#Eval("ID") %>' />&nbsp;<asp:Button runat="server" ID="btnDown" Text="Down" CommandName="MoveDown" CommandArgument='<%#Eval("ID") %>' /></td>
                    </tr>
                </ItemTemplate>
                <FooterTemplate>
                         </tbody>
                    </table>
                </FooterTemplate>
            </asp:Repeater>
            <%if (rptInventory.Items.Count == 0)
              { %>
              Please choose a category on the left to view products
            <%}%>
            </td>
        </tr>
    </table>
</asp:Content>
